package com.ljl.forum_1.dao;

import com.ljl.forum_1.model.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int insert(Article row);

    int insertSelective(Article row);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article row);

    int updateByPrimaryKeyWithBLOBs(Article row);

    int updateByPrimaryKey(Article row);

    // 查询所有帖子列表
    List<Article> selectAll();

    // 根据板块Id查询帖子列表
    List<Article> selectAllByBoardId(@Param("boardId") Long boardId);

    // 根据帖子id查询详情，返回帖子详情
    Article selectDetailById(@Param("id") Long id);
}